home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
PRINTER
/
WSD40E.ARJ
/
WSD-ENG.DOC
< prev
next >
Wrap
Text File
|
1992-06-17
|
55KB
|
1,265 lines
(* ------------------------------------------------------------------
Helmut Steeb 03.07.91 TURBO-PASCAL 5.5
S+C-AT 286, Herculesgraphik, 1MB RAM, MS-DOS 3.30
486/33, VGA-Graphik, 4MB RAM, DR-DOS 6.0
WSD-ENG.DOC
From: 17.06.92
------------------------------------------------------------------ *)
──────┤ WSD ─ your text formatter by Helmut Steeb ├──────
Contents
--------
What is WSD?
A short introduction
Description of files
How to install WSD
Formatting texts with WSD
How to start WSD
Printing modi
Escape characters
Additional escapes in head and foot lines
Page layout
Shortcuts for escapes
Appendix
A) Printer requirements
B) List of dot commands
C) How to construct your proportional table
D) Bugs, problems, missing features
------------------------------------------------------------------
What is WSD?
------------
WSD is "yet another text formatter". Its functionality is styled
similiar to WordStar 3.0. In fact, I made the first version of WSD
because WordStar 3.0 lacked some features which I'd liked to have.
These are especially printing user defined fonts, printing in double
height and with several printing features the printer supported. "WSD"
means "Word Star Druck" (Word Star Printing). But Word Star was not
the last word to WSD. I have worked on WSD continuously. Today, the
most important features of WSD are:
- printing ONLY on 24-dot matrix printers (at the moment)
- WSD formats your text in proportional spacing, with left and right
justification. Proportional spacing is the most readable print style
- characters are of different width, then, e.g., "i" is not as wide
as "w".
- Automatic hyphenation!
- Checking your text file in advance before actually printing
- Print styles can be mixed:
* Proportional spacing normal/narrow, 10 cpi (characters per inch,
the usual spacing), 12 cpi, 15 cpi, 17 cpi and 20 cpi (narrower)
* LQ (letter quality) or draft quality
* Printer internal or user defined fonts (for foreign language
characters, calligraphic fonts, maths...)
* double wide and double high print style, italics, underline, bold,
superscript, subscipt.
NOTE: double high print style is not correctly taken into account
for vertical page layout at the present.
- page format with one or two columns (to be mixed on the same page)
- page style "normal" / only "left" pages / only "right" pages /
twosided
- variable line spacing 8 / 6 / 4 lines per inch (the same as 0.5 / 1
/ 1.5 on some typewriters).
- WSD is a mere text formatter. The printing features (italics,
underlined, etc.) are not visible on screen, only on paper you will
see them. This is not "what you see is what you get". You write your
text with your favourite text editor (I am using QEdit, by the way).
WSD will do the formatting and printing.
To control printing, you add formatting commands to your text. These
are:
* "escapes", following after the "escape character" "#". For
example, "#K" means "italics on", and "#k" means "italics off".
* "short cuts" (abbreviations) of escapes. Short cuts for escapes
are not important at the beginning. More about them can be found
below (I don't use these very often).
* "dot commands". Their purpose is in general to control printing
layout. Dot commands are text lines which start with a dot in the
first text column (in regular text lines, this is assumed to never
occur). These lines with a dot in the first column are only to
define layout features. They will NOT be printed. For example, to
switch to two column printing, you would use the following command
placed in the first print column:
.2c
------------------------------------------------------------------
Short introduction
------------------
I suppose, before reading all the rest of this text, you'd like to get
a quick taste about WSD. My proposal: just give it a try now!
To this end, all files of the WSD archive should be together in a
subdirectory. Now change dir to that directory, e.g.,
A:
CD WSD
and make your printer ready. NOTE: the print head should be
immediately below the top paper border (if you are using a sheet
feeder, we must think a bit over that. May be this can be managed by
adjusting the paper layout, i.e., you should then decrease the top
margin and increase the bottom margin. See below on these notions).
Now start WSD by
WSD -c WSDDEMO
WSD will check (-c) the file WSDDEMO.TXT and tell you that no error
occured (by adding -c, you can always suppress printing to only check
the input file). Fine! Now becoming serious, type
WSD WSDDEMO
Afterwards, (hopefully) you see your first WSD formatted text on the
printer. It is a demo, so don't bother that it is in German language.
Just enjoy the printing features. If there are some less beautiful
phenomena, you should seemingly proper install WSD to your printer.
For printers as NEC P6, there should be no problems. If you like it,
go on trying some more texts. Or just more promising, have a try with
LISTING WSD-ENG.DOC
Be told again: if you add option -c when calling WSD, then the input
file will only be checked, not actually be printed. As a side effect
you will see the number of pages needed.
You can also print first all pages with odd page numbers, then turn
the sheet round, then print all pages with even page numbers:
LISTING WSD-ENG.DOC /po
... turn all round ...
LISTING WSD-ENG.DOC /pe
If you like it still smaller, do it with LISTING1 instead.
Some remarks are in order here (for details see the following
chapters):
- the batch files LISTING.BAT etc. all call the WSD.EXE program. If
there are problems, make sure that LISTING.BAT etc. contains the
correct actual path to WSD.EXE.
- the files FONTTST1.TXT, FONTTST2.TXT and SAMPLE.TXT all try to print
user defined fonts. This will only work if your printer is prepared
to print user defined fonts, and if the file WSD.CFG contains the
correct path to the fonts (entry FO=xxx; the fonts are all named
with extension .LET and come in the LETTER subdirectory). You can
always print these files with LISTING because LISTING suppresses the
font switching commands.
------------------------------------------------------------------
Description of files
--------------------
WSD is no "integrated" environment as some commercial available
programs are. The formatting process is controlled by some files which
are read by WSD at program start. You can easily adapt these files
using a simple text editor.
WSD EXE The program
WSD MSG message file
MUST be available at program start. Without this file, WSD would not
be able to communicate with you. The idea behind this is to allow
simple adaptation to various languages. Actually, you need not copy
your adapted file onto WSD.MSG. On startup, WSD first checks the
value of the environment variable WSDMSG and tries to read that
file. If this succeeds, WSD.MSG need not be there. For further
information see below in the chapter on Installing WSD.
WSD CFG configuration file
MUST be available at program start. You can write a configuration
file of your own and tell WSD to use that via a command line
parameter. In the configuration file, some general data for
formatting are specified. These are tabulator width, for example, as
well as the names of other files used by WSD (hyphenation info,
printer information, etc.).
NECP6 ESC
MUST be available at program start. The name of the file to use is
specified in the configuration file. This file defines the
connection of text characters following "#" with printer escape
sequences. For example, the file says that the character sequence
"#K" in your text will be replaced by the printer codes ESCAPE "4"
(ESCAPE is a special character for printer control). On most
printers, ESCAPE "4" will switch to italic printing. Besides that,
the file contains escape sequences which are sent to the printer as
initialization strings and the like. Short cuts can be found there,
too.
This escape file may be changed in order to:
* adapt WSD to special printers which don't use the common escape
sequences. For example, you could easily tell WSD to replace "#K"
by ESCAPE "X" instead of ESCAPE "4". This makes sense if your
printer is switched to italics via ESCAPE "X".
* change the text characters which invoke printing features. If you
don't like "#K" to turn italics on, change the escape file so that
"#j" switches to italics (if you think this makes sense).
* define or change short cuts for escapes.
GHMIN HYF
File with hyphenation info (need not be there). The name of the file
to use is specified in the configuration file. The hyphenation info
as well as the hyphenation procedures are due to the TeX text
formatter. GHMIN.HYF contains the information of GHYPHEN.MIN
(delivered with EmTeX by Eberhard Mattes) in compressed form.
GHMIN.HYF works very fine with german words.
HYPHEN HYF
The same as GHMIN.HYF, but for English texts.
MAKEHYPH EXE
Utility program to construct hyphenation files from TeX-style
hyphenation files.
NECP6 WID
NECP6PL WID
LC2410 WID
These files specify the width of all the characters in proportional
spacing on the respective printer. There MUST be one such file at
program start. Which file WSD will use is defined in the
configuration file. WSD must be told how many dots the various
characters need on paper. This is especially necessary to left and
right justify the output lines. Formatting will work nonetheless
with files that do not contain the exact widths of your printer. The
result will merely be that the right margin will not be properly
justified. If your printer is none of the above, refer to the
appendix (it tells you how to find out the spacing data of your
printer).
PROPTEST.EXE
Program to find out the proportional spacing data (see appendix).
LISTING FRM
File with layout data, e.g. two columns or not, right justification
off, draft quality, condensed. You can use this file to print
listings or similiar "raw" data. Since each column will contain one
usual print page, you need only half the paper. To use this file,
call WSD /fLISTING or just LISTING.BAT (with additional parameters,
as needed).
Comment: some people like enormously spaced, few information on one
paper. I like to see much small printed data on one paper because it
is easier, then, to grasp cross references. For listings, I find it
very convenient to have two conventional pages on one sheet. Buf if
you prefer the first mentioned style, forget everything about
LISTING.FRM.
LISTING BAT
Batch file. It calls WSD with parameter /fLISTING. To print a Pascal
file DATEI.PAS using the format data from LISTING.FRM, just issue
LISTING DATEI.PAS
If you call LISTING.BAT from another directory, not where WSD.EXE
resides, you must probably enter the actual path to WSD.EXE into
LISTING.BAT (and LISTING1.BAT etc.). See below on installation of
WSD.
------------------------------------------------------------------
How to install WSD
------------------
In case you didn't, to read the previous chapter (description of
files) would probably be helpful before you install WSD.
First copy all the files in a new subdirectory (unless already done so
by PKUNZIP). WSD.EXE is the executable program. It is called from
within LISTING.BAT, LISTING1.BAT and LISTINGQ.BAT. If you want to call
LISTING.BAT from another directory, not where WSD.EXE resides, you
must probably enter the actual path to WSD.EXE into LISTING.BAT (and
LISTING1.BAT etc.). If, e.g., WSD.EXE is in the directory D:\TEXT\WSD,
the call in LISTING.BAT should look like
D:\TEXT\WSD\WSD /fListing ...
At program start, WSD reads the file specified in the environment
variable WSDMSG, or the file WSD.MSG. Just for now, the file WSD.MSG
will be good. If you like to adapt WSD to German language, for
example, simply issue the command
SET WSDMSG=WSD-GER.MSG
before running WSD. In this case, it will do no harm if WSD.MSG is not
present. It is then even possible to run WSD from another directory
(not where WSD.EXE and WSD-GER.MSG are); WSD will automatically search
for the message file in the directory in which WSD.EXE resides.
If you aren't able to set the environment variable because the
environment lacks space, you should adapt your computer's system file
CONFIG.SYS also. To this end, increment the value after /E: in a line
like
SHELL=C:\DRDOS\COMMAND.COM C:\DRDOS\ /P /E:512
If you are not sure how this works, see the documentation for your DOS
operating system.
After reading the message file, WSD reads the configuration file
WSD.CFG (or whatever file you specify on the command line, e.g.
/cMYCONFIG; ".CFG" will be added automatically). Installing WSD, the
main thing is to set up the data in WSD.CFG appropriately. We now
turn, therefore, to an explanation of these data (with examples).
wi=necp6.wid
WI (WIdth) denotes the file with proportional spacing information.
This line MUST be there in the configuration file. If your printer
is one of NEC P6, NEC P6+ or Star LC 24 10, just enter the name of
the respective file (NECP6.WID, NECP6PL.WID, LC2410.WID) after
"wi=". If there is no file for your printer, you can for the
moment use one of the other files. Refer to the appendix to see
how you can build such a file for your printer.
es=necp6.esc
ES (EScapes) denotes the file with escape sequences. This line
MUST be there in the configuration file. Since most dot matrix
printers will accept the NEC pinwriter escape sequences, for most
printers you can just leave the line as "es=necp6.esc". If you
later find that some printing features (italics, bold etc.) don't
come to paper as you think they should, then you should do
something. Produce a copy of NECP6.ESC, give it the name of your
printer, and refer to your printer's manual whether some data in
the file should be changed.
fo=c:\text\font
FO (FOnt-directory) denotes the directory, in which WSD looks for
user defined fonts. If you specify font file names using the dot
command FT, these names will be preceded by the FO-value. Example:
in your text, you write .FT=greek. With fo=c:\text\font, WSD will
look for c:\text\font\greek.let. If you don't specify FO, WSD will
look for the fonts in the current directory.
ff=yes
FF (Form Feed). If a page is printed, WSD can either use the
printer's internal form feed (ff=yes), or it can produce the page
break by sending several line feeds to the printer (the exact
number depending on the page layout; this is with ff=no).
wa=no
WA (WAit). With wa=yes, WSD will pause at the end of a page and
wait for a keystroke. Nowadays, wa=yes seems to be no more
necessary. There have been problems when entire font files were
downloaded to the printer; these problems didn't occur when WSD
waited on a keystroke before form feeds and before downloading a
font file. But possibly, these problems were caused by a bug.
ta=8
TA (TAbulator size) specifies the number of blanks that will be
inserted internally to replace a tab character (ascii 8).
Personally, I don't use tab characters, I even don't like them. It
seems to me that text files containing tab characters are not
properly treated by WSD but don't be amazed if I didn't fix that
problem yet. Some editors can be customized to produce no tab
characters but to replace them with blanks themselves.
pm=c
PM (Page Mode) is the default page mode for WSD. It is in effect
as long as you don't issue the dot command .PM. The page mode
says:
- whether for the left paper margin the value of IR (indentation
left) or IR (indentation right) shall be used
- whether for the top line of the pages the line specified by dot
command HL (head left) or HR (head right) shall be used
- whether top and bottom lines are printed left or right justified
(lines which are split by "#>" are not affected)
Legal values are (upper or lower case):
- R (Right): use IR and HR always, print top and bottom lines
right justified (except lines containing "#>")
- C (Center): use IR and HR always, but center top and bottom
lines (except lines with "#>")
- L (Left): use IL and HL always, print top and bottom lines
left justified (except lines with "#>")
- 2 (2-sided): for even page numbers the same as L, for odd ones
as R.
hy=hyphen.hyf
HY (HYphenation table) denotes the hyphenation table file.
Hyphenation tables can be produced via the utility program
MAKEHYPH.EXE from original TeX hyphenation tables. The file
GHMIN.HYF has been built from GHYPHEN.MIN and contains exactly the
information of the latter in compressed form. For printing English
texts, the table HYPHEN.HYF (produced from HYPHEN.TEX) should be
suitable. If there is no HY-definition, WSD will not do any
automatic hyphenation.
in=
IN (INclude-file) denotes a file that will be read before your
actual input text is read. It makes sense to specify a file
containing formatting data (e.g., dot commands). The extension
.FRM will be supplied automatically. If you use parameter /f on
the command line, the line in the configuration file will have no
effect.
ig=no
IG (IGnore dot commands in verbatim-mode). In verbatim mode, all
text escape characters (#x) and all short cuts ($x) are printed
without interpretation. Only with dot commands, you can choose:
* with ig=no the dot commands will be interpreted, as done in the
other printing modi. They will not appear on the paper
themselves.
* with ig=yes, all dot commands are printed as text. The only
exception is .)) which must be interpreted since it turns
verbatim mode off.
If you want to print "raw texts", listings for example, there may
a large amount of "#" and "$" characters in them. Verbatim mode is
very helpful in these cases since in verbatim mode, the characters
are not interpreted but simply printed. In formatting mode, the
characters can only be printed by doubling them: to print "#", you
write "##" in your text, as well as "$$" for printing "$". In
general, you will use ig=no in verbatim mode since then you can
control even printing of raw texts via dot commands. ig=yes will
only be necessary if you want to print a text that has dot
commands in it, and you want to print these on paper.
Well, this is a description of the configuration file. As far as I can
tell, everything is now said about installing WSD.
Further note concerning file names:
The files which are specified in the configuration file must be under
the there mentioned name either in the WSD directory (where WSD.EXE
resides), or in the current directory. The search for the files
proceeds in this order. In this case, NO file name extensions are
automatically supplied. This is different as for your command line
parameters.
Format file, configuration file and input text file will also be
searched for in the WSD and then in the current directory. If not
found, and if the file name did not contain an extension, a default
extension will be supplied for the respective file type, and the
search is done again in the mentioned order. If it is not found again,
you will get an error indication, and WSD stops.
------------------------------------------------------------------
Formatting texts with WSD
-------------------------
How to start WSD
----------------
Simply invoke WSD with
WSD
or
WSD /?
to get a help screen dealing with options and parameters. These data
are now explained in detail.
What you MUST specify to work with WSD:
1) the name of your text file. All DOS pathnames are allowed. Not
allowed are wildcards like * or ?, as well as character oriented
devices like CON (you want to try "WSD CON"? Don't do it!). Things
like DIR | LISTING are not possible. If your text has the
extension TXT, you need not type these characters since WSD will
supply them automatically. Example:
WSD file.txt
produces the same as
WSD file
What you CAN specify to work with WSD:
2) the name of the output file. All DOS pathnames are allowed here,
too, as well as character oriented devices (e.g., PRN). The output
file name must be specified AFTER the input file. In fact, this is
the only restriction about the ordering of command line
parameters. Example:
WSD file.in file.out
If you don't specify the name of an output file, WSD will
gracefully assume PRN for you. If you specify one, output
including printer escape sequences will be directed to that file,
so later on you can print it via
COPY file.out PRN
3) Several options. Options work as toggles: they toggle features of
WSD on or off. Options are denoted by single characters, upper or
lower case doesn't matter. On the command line, options must be
preceded by "-". You can sum up several options after one "-". As
already mentioned, options can be located at any position in the
command line. Examples (both have the same effect):
WSD -c file.in -d
WSD -cd file.in
The default values of the available options are displayed on the
helpscreen by invoking WSD /?.
- Option -C (Check Syntax): WSD then analyses your text without
producing output. If there are any problems during the analysis,
WSD will report afterwards how many problems occured. All
problems are protocolled into a file named WSD.LOG. NOTE that
this protocolling occurs in any case, even if you did not
specify -C.
Examples: Assume the text escape character "z" is undefined in
your escape file. WSD will then report the occurence of #z in
your text file. In verbatim mode, WSD reports lines which are
too long for the current line length (it will automatically wrap
these lines at word boundaries, if possible. Otherwise, they
will be suppressed).
ERGO: it is VERY HELPFUL to check your text first with option
-c. If WSD reports problems, refer to WSD.LOG, change your text,
if necessary, and only then go on printing. Option -c can save
you a lot of paper...
- Option -L (Load Font): only for use of user defined fonts.
Probably only for NEC P6.
Usually, WSD loads the character definitions of a user defined
font into main memory. Only if a certain user defined character
must actually be printed, the pixel data will be loaded into the
printer. This allows to intermingle printing of several fonts
without at each occurence of another font downloading that font
entirely. But (at least on our NEC P6) there may be a problem if
the double high or underlined printing features where active
before loading the pixel data: there will be a small but
noticeable forward paper motion. If you want to print an
underlined headline, it will be printed nicely "downstairs".
This effect doesn't occur if the pixel data for the characters
are already in the printer's download memory. So the trick is to
ensure that the font is already downloaded as a whole. I did it
as follows: before headlines that I wanted to print in a user
defined font, I put the FT font dot command. Also, on the
command line, I set the option L. Option L then causes the font
to be loaded to the printer immediately when FT occurs. May be,
this is specific to the NEC P6, so forget all about it.
- Option -P (Preview):
** not yet implemented **
- Option -D (Dump): not recommended. Internal data which are build
during the analysis of your file are output to the file named
WSD.TST. This option is helpful for programmers and bug fixers
of WSD. The output file can become rather large! Only the pages
which are selected by parameter /p will be dumped.
4) Various parameters. Parameters follow the character "/". They
also can be placed at any position in the command line.
- Parameter /P (Pages): decides, on which (output) pages WSD shall
work. In any case, WSD starts analyzing your text from the
beginning of the file, even if the first page(s) are not to be
printed (how should WSD recognize where the second output page
begins if it did not process the first?). WSD stops when the
last specified page has been processed. If you don't specify
parameter /p, all pages will be processed ("all" means: up to
page 255. You know, the "byte" and stuff).
Immediately following the "/p", you can write several ranges of
text pages, these are delimited by periods. The following ranges
are possible:
Example Effect
--------------------------------------------------------
10 single page
-10 all pages up to page 10 (inclusively)
10- all pages, beginning from page 10 (inclusively)
5-7 pages 5 thru 7
e (also E) all even pages, i.e. 2, 4, 6...
o (also O) all odd pages, i.e. 1, 3, 5...
Examples of complete page specifications:
/pe all even pages
/pe.1-3 pages 1, 3 and all even pages
/p10 page 10
/p10 /p2-3 pages 2, 3 and 10
As you may have noticed, the several ranges are implicitly
combined by OR (union), not by AND (intersection). Thus, /pe.1-3
denotes NOT just "page 2 only" but moreover "all even pages +
pages 1-3", i.e., pages 1, 2, 3, 4, 6, 8 etc. When processing
your file, WSD will show selected page numbers in brackets like
[1], suppressed pages will be displayed surrounded by dots like
.2. In detail, the opening bracket will be displayed before the
analysis of the page starts. The page number will be displayed
after the page has been analyzed, the closing bracket after the
page has been output. Example:
[3] .4. .5. [6]
If you press any key while WSD is working on your text, you will
enter a dialougue with WSD after the current page has been
processed (on that point, refer also to the chapter on
installation, feature DI). In this dialogue, you can redo the
page selection, starting at least from the next page (you can't
work on previously finished pages again).
Note: if you decide to exit printing immediately, then WSD will
nonetheless try to return your printer into a well defined
state (which includes your exit string, see file with escape
sequences). If you simply turn your printer off, and then type
"x" to exit from printing, WSD will try to send the exit data
to your printer. Because this is no more possible, it will
then abort with a rather mysterious "runtime error 160" (which
means exactly "device write fault"). So either don't turn off
your printer too soon, or else just ignore the error message.
- Parameter /F (Format): this parameter must denote a file. The
file will be analyzed as include file before your text is worked
on. Therefore, it will be convenient to save commonly used
layout values (dot commands) as a file and supply them on the
command line via /f. The extension FRM will automatically be
added. Example:
WSD /flisting wsd.pas
Note, that /f suppresses the configuration file datum IN. If
your configuration file says IN=DINA4.FRM (extension there
necessary!), and you invoke WSD with parameter /fLISTING, only
LISTING (or LISTING.FRM) but not DINA4.FRM will be processed.
- Parameter /C (Config): in place of WSD.CFG the specified
configuration file will be used. Extension CFG will be supplied
automatically (probably /C is not necessary).
------------------------------------------------------------------
Printing modi
-------------
WSD prints texts in three different modi:
- F+ (formatting): WSD formats your text automatically left and right
justified. It doesn't matter where the input lines end. WSD reads
word after word and fills the output lines as good as possible
with microspaces to get the justification (note that WordStar 3.0
did not work with proportional spacing fonts and, as I remember,
filled lines with blanks only which is rather crude).
Note that there is a great difference between the job of a typist
and the job of WSD! A typist (and most likely WordStar 3.0) types
fixed width characters and fills in an appropriate number of
blanks between the words to get right justification. You easily
recognize such output because all the characters are positioned
column for column in the same manner.
WSD does more: it uses proportional fonts. If you have a look at
the next book at hand, you will find that in professional printing
characters are of different widths: "w" takes more horizontal
space than "i", for example. This makes texts more readable. To
print such texts right justified, WSD must be told what widths all
the individual characters have. Given these widths, WSD computes
the width of a complete line and appropriately fills in pixel
space (not blanks) in order to right justify the line.
To end a paragraph, you place an empty line into your file (such
as the one before "To end..."). At this point, WSD will stop
continuous formatting and place an empty line into the output,
too. To get a line break within a paragraph, insert the text
escape "#." (hash, followed by a dot). But, admittedly, I didn't
use this feature extensively, neither did I test it.
In the output, the lines will be indented as you indented them in
the input file. Since source and output lines can be of different
length, there are somewhat subtle problems with this statement. To
be exact, note the following: "For every output line WSD uses the
indentation of that input line, in which the output line was
begun" (i.e., in which the first word of the output line was
found). If you, for example, write paragraphs of the form
Keyword: 1111 2222 333 444 555 65666 7777 8888 9999 2020
aaa bbb ccc and so on...
and format these lines rather narrow, then you will get something
like
Keyword: 1111 2222 333 444 555 65666
7777 8888 9999 2020 aaa bbb ccc and
so on...
The point here is that the second output line, beginning with
7777, was begun while the first input line was still active
(because 7777 comes from the first input line). Therefore, the
indentation of the second output line is taken from the first
input line. Since you surely want the lines to look like
Keyword: 1111 2222 333 444 555 65666
7777 8888 9999 2020 aaa bbb ccc
and so on...
you should in such cases simply shorten the first input line like
Keyword: 1111 2222 333
444 555 65666 7777 8888 9999 2020 aaa bbb ccc and so on...
In this case, when the 7777 is processed, it will infer the proper
indentation of the second input line to the respective output
line.
Alternatively, WSD does the indentation similiar to English
documents: the first line of every paragraph is indented, all the
rest of the lines will be left justified. You get this if you
specify parameter /i on the command line, after the /i telling how
many characters the first line shall be indented. Note that /i0
will have the same effect as leaving /i at all: paragraphs will be
formatted according to the input file indentation.
Example: WSD mytext /i4
- F- (Non-formatting mode): your text will be output line after line,
just as you wrote it. Text escape characters are interpreted into
the respective printing features. When an output line becomes too
long (with respect to the line length specified by dot command
LL), then the rest of the line beginning from the out dropping
word will be placed into the next output line. The misery will be
protocolled into the log file. Example:
When an output line becomes too long (with respect to the length
will (according to LL) be formatted to
When an output line becomes too long (with respect to
the length
Besides this step all output lines will exactly correspond to the
input lines. Dot commands won't be printed but interpreted.
When printing listings, it may happen that many lines are too long
and will be wrapped. The output will then be badly readable. For
this reason, WSD allows you alternatively to shorten these output
lines and simply suppress the out dropping parts. I use this
feature when printing Pascal programms: the suppressed parts are
almost always the final words of comments which I consider to be
neglectable, then. Note that only whole words are suppressed. This
means that the word that does not fit on the line entirely will be
suppressed as a whole.
Suppressing is only in effect in mode F-. It will be enabled by
option -s, for example: WSD mytext -s.
- (( (verbatim, direct mode): your text will be output line for line,
exactly as you can see it on the screen. Text escape characters
are NOT interpreted but printed as characters. Dot commands are
either interpreted (as in the other printing modi), when ig=no is
specified in the configuration file, or they will be printed as
well, with ig=yes (see chapter on installation).
Lines which are too long are automatically wrapped or shortened as
in F- mode. Verbatim mode can be very helpful to print tables or
texts containing a lot of special characters, since the characters
# and $ are not interpreted but simply printed. The dot command EV
(escape verbatim) allows you to specify an escape sequence which
will be inserted automatically when WSD meets the verbatim
enabling dot command ((. For example, with EV=#p#q, in verbatim
mode there will proportional spacing and LQ be automatically
turned off, i.e. draft is turned on. The dot command )) then
restores the printing state which was active before entering
verbatim mode.
------------------------------------------------------------------
Escape characters
-----------------
To achieve special printing features, simply insert the escape
character # into your text, followed by one of the characters
introduced below (e.g., this is #Sunderlined#s and that is #Dbold#d):
s underline off
S underline on
d double strike off
D double strike on
c condensed off
C condensed on
q LQ off (= draft on)
Q LQ on
v double high off (= normal height)
V double high on
k italics off
K italics on
b double wide off
B double wide on
p proporitional spacing off (= LQ/draft on, according to q/Q)
P proporitional spacing on
t superscript/subscript off
T superscript on
U subscript on
N 10 cpi (additionally condensed results in 17 cpi)
E 12 cpi (additionally condensed results in 20 cpi)
e 15 cpi (additionally condensed results in 20 cpi, too)
I Internal printer font
X user defined font 1
Y user defined font 2
Z user defined font 3
The sequence "#." in the input text in mode F+ (formatting mode)
produces an immediate line break at this position. In other modi, it
is ignored. Note that this feature is not extensively tested, there
may occur faults.
To print character "#", write "##". All other characters are NOT
ALLOWED after "#" and are reported as errors. Therefore, if you want
to print a text you didn't write yourself, be sure to double all
occurences of "#" to get to desired result, e.g., "phone ##43". This
is not necessary for verbatim mode since there no escape characters
are interpreted.
------------------------------------------------------------------
Additional escapes in head and foot lines
-----------------------------------------
In head and foot lines (or should we call them top and bottom lines?)
all the above escape sequences are allowed, except "#." and double
heigth on/off. Furthermore, the following "short cuts" are possible
(note that upper/lower case is of importance here):
$P print the current page number at this position
$| split the line at this position. The left part will be printed
left justified, the right part will be printed right justified.
When it occurs more than once in a top or bottom line, only the
last occurence will be taken into account. As a side effect, the
current page mode (PM) has no effect on the line since it is
split.
$D insert date, format: 07-05-1991 ( = 5th july 1991). The actual
date format used depends on the specification in the message file
(i.e., the file specified via SET WSDMSG=xxx, or else the file
WSD.MSG).
$T insert time, format: 09:27pm. The actual time format used also
depends on the respective specification in the message file.
$n insert name of text file - i.e., the name you specified on command
line, supplied with .TXT if necessary. $n only prints the name and
extension part.
$N like $n, but the entire path of the file will be printed.
Examples:
.he $n ($D $T)$|Page $P
results in
INFILE.TXT (07-05-1991 09:29pm) Page 1
INFILE.TXT (07-05-1991 09:29pm) Page 2
etc.,
.hl $P$|$n
.hr $D $T$|$P
results on left pages (odd page numbers) in
1 INFILE.TXT
and on right pages (even page numbers) in
07-05-1991 09:31pm 2
------------------------------------------------------------------
Page layout:
------------
The following values are only examples for possible dot command data.
---------------------------------------------- top of paper
1 (printing head start pos.) ) )
2 head line .HE ) )
3 ) ) .MT = 4 ("margin top") )
4 ) .HM = 2 ("head margin") ) )
5 Beginning of text! ... In the beginning was the word, )
6 and the word was with God, and the Word was God. He was )
7 with God in the beginning. Through him all things were )
8 made; without him nothing was made that has been made. In )
9 him was life, and that life was the light of men. The light )
10 shines in the darkness, but the darkness has not understood )
11 it. )
... )
56 The true light that gives light to every man was coming into )
57 the world. He was in the world, and though the world was )
58 made through him, the world did not recognize him. He came )
59 to that which was his own, but his own did not receive him. )
60 Yet to all who received him, to those who believed in his )
61 name, he gave the right to become children of God - children )
62 born not of natural descent, nor of human decision or a )
63 husband's will, but born of God. )
64 (Gospel of John, chapter 1). End of page text. )
65 ) ) )
66 ) .FM = 2 ("food margin") ) )
67 foot line .FO ) )
68 ) .MB = 6 ("margin bottom") ).PL=70
69 ) )
70 ) )
---------------------------------------------- bottom of paper
------------------------------------------------------------------
Short cuts for escapes
----------------------
To allow an abstraction level over text escapes, there are short cuts
for escapes. Suppose, you want to print all head lines in a document
bold and underlined:
#D#SMy headline#d#s
There are some other text elements, say, proper names, which you mark
by printing them in italics. Later, you are no more happy about this
choice of printing features. You'd like to print the headline double
wide instead, and the proper names bold. What to do?
One idea is to define short cuts for escapes. In your escape file, you
define that $H shall mean #D#S, and $h shall mean #d#s. Then you write
only
$HMy headline$h
and the like. This gives also raise to mnemonic references instead of
longer lists of escapes. And to change the style of the headlines, you
simply change the short cut definition, for example, to mean $H #B
instead of #D#S. May be, you do use this feature even less than I do,
but nevertheless: here it is.
To print "$" in your text, you must protect it by doubling it: "$$".
"$25.00" is to be written as "$$25.00". In verbatim mode, invoked by
((, the character "$" will be printed without interpretation.
------------------------------------------------------------------
Appendix A) Printer requirements
--------------------------------
To print user defined characters, you must print on a 24 dot matrix
printer. If you don't print user defined characters, WSD can probably
also work as desired on 9 dot matrix printers. Versions for deskjets
and laserjets are possible but not yet available. The following will
be of interest to you if there are problems between WSD and your
printer.
In any case, the printer must meet the following requirements (refer
to your printer manual; the mentioned codes are fix programmed in
WSD):
1) it must be able to do a relative horizontal pixel motion, and that
must be invoked by the escape sequence ESC "\", followed by two
bytes. In proportional spacing and LQ, the unit will be 1/180 pixel,
in draft 1/120 pixel. (Comment: draft has another unit, as you see.
This is not fine for WSD. Since there are problems, in mode F+ WSD
actually switches to LQ mode to do the relative motion and then
switches back).
2) it must be able to do a relative vertical pixel motion, and that
must be invoked by the escape sequence ESC "3", followed by a byte.
The unit is 1/180 pixel.
3) The form feed is invoked by ascii 12. If your printer doesn't meet
that requirement (ever seen such a printer?), you can specify FF=no
in the configuration file, also.
If you want to work with user defined characters:
4) you MUST print on a 24 dot matrix printer. The pixel data are
fundamentally different on 9 dot matrix printers.
5) Loading of user defined data is initiated by ESC "&" 0.
6) Take into account that probably you must setup your printer
differently in order to allow working with user defined characters.
For example, the printer NEC P6+ uses the needed printer memory area
in the usual setting just as printer buffer.
7) WSD assumes a certain format of pixel data for user defined
characters. Accordingly, it sends the data to the printer. The
format is taken from the NEC P6 manual, but it seems to be the same
on a wide range of 24 dot matrix printers. The pixel data are
grouped into 3 byte groups, where each group defines the appearance
of one pixel column of the character.
------------------------------------------------------------------
Appendix B) List of dot commands
--------------------------------
NOTE: the first character immediately past the two dot command
characters is ALWAYS ignored. So write .MT 4 and not .MT4 !
.. some line
Comment line, will not be printed.
F+ Formatting mode on.
F- Formatting mode off. The current output line will be output
immediately.
(( Verbatim mode on. All characters are immediately printed. With
ig=yes (in configuration file), even dot commands except )) are
verbatim printed. With ig=no, dot commands are interpreted. The
printer will receive the escapes sequences which are defined via
EV ("Escapes for Verbatim mode").
)) Verbatim mode off. Restores the printer mode which was active
before )), e.g., F+, as well as the respective printer state,
e.g., proportional spacing in italics.
EV sequence
Defines printer state which is automatically entered when
verbatim mode begins. Default is: empty sequence (but see
LISTING*.FRM). Maximal length is 10 characters. Example: EV #p#q
1C One column printing on.
2C Two column printing on.
IMPORTANT: in two column mode the dot commands LH and LL are not
allowed. They should therefore always be issued BEFORE 2C.
CO Start new colomn (in two column mode, new page in one column
mode)
PA Start new page
PN n Use new page number (starting from current page)
OP Suppress page number which is as default printed in bottom
line. If you specify HE, HL, HR or FO, these also suppress
the default.
HL line
head (top) line for left pages
HR line
head (top) line for right pages
HE line
head (top) line, defines both HL and HR
FO line
foot (bottom) line
EH sequence
Text escape character sequence, defining appearance of top
lines. In fact, this sequence is simply put in front of all
lines which you specify via HE, HL or HR. Example:
.EH #T
.HL Top line for left pages
results internally in
.HL #TTop line for left pages
which means that all your top lines will be printed in
superscript. Note that you need not be concerned to switch this
superscript off again because WSD automatically restores the
previous printer state when the top line is finished.
EF sequence
Text escape character sequence, defining appearance of bottom
lines. This works analogous to EH.
IL n Left margin for left pages (unit see below).
IR n Left margin for right pages (unit see below).
FT n Name [Q]
Load font into main memory, Q: LQ-Mode, otherwise in
proportional spacing. N may be 1, 2 or 3. "FT 1 name" defines
the font to be used in connection with #X, "FT 2 name" for
#Y, "FT 3 name" for #Z. Note that Name must not contain a
path; .LET will be supplied if you didn't. NOTE: in two
column mode, you must not load different fonts on the same
font number - while in the left column font kk is needed for
#X, due to the right column there would font mm be needed for
#X which is a very bad situation for WSD.
DL n Download a font (which has already been loaded to main memory
via FT) into the printer memory. This can be issued as often
as you like.
IN Name
Include file Name. The include file must itself not contain
the dot command IN, and it should be terminated with a line
feed.
LH n Set line spacing. Default is 2 which corresponds to "1" on
some type writers, 1 corresponds to 1/2 (half), 3 to 1 1/2
(one and a half). This command does not affect the current
layout data MT, MB and PL - these denote the paper layout
with respect to the default spacing LH 2. LH 2 is the usual
line spacing; it results in 6 lines per inch. LH 1 results in
a closer spacing (8 lines per inch), and LH 3 in a wider
spacing (4 lines per inch).
LL n Set line length for formatting. In modi F- and ((, too long
lines are protocolled into the log file. IMPORTANT: in two
column mode, the length of one line within a column is
computed by subtracting the column separation CS from LL and
dividing the result by 2.
CS n Set column separation for two column printing.
PL n Page length (unit see below)
MT n top margin (unit see below)
MB n bottom margin (unit see below)
HM n distance of top line from text area
FM n distance of bottom line from text area
The layout dot commands MT, MB and PL are based on the default line
height of 6 lines per inch. Therefore, for the text of a page, PL -
MT - MB lines are effectively used.
When the default line height LH 2 is set, on any paper will PL - MT
- MB be printed. By changing the line height, you will get more or
less lines on the paper.
All dot commands concerning width (IL, IR, LL, CS) are based on the
width of a "normal" character, i.e. 36 pixels. This is the pixel
width of a character in the default pitch LQ 10 cpi.
------------------------------------------------------------------
Appendix C: How to construct your proportional table
----------------------------------------------------
Start the program PROPTEST.EXE after you made your printer ready. The
program writes (rather noisy) some pages in proportional spacing. In
every line, you find a certain character printed twenty times side by
side. With this pages, you can find out the proportional width of your
printer's font.
1) For every printed line, do the following:
Measure how wide the twenty characters are altogether. A typical
value for character "A" might be 5.6 centimeters. The width of one
character (in cm) is then the twentieth part of your measured value.
To get the pixel width of the character, divide the value by 2.5
(since one inch has 2.5 cm - this division is of course not
necessary if you did measure in inches already but this is not my
affair), then multiply the result with 360 (for one inch has 360
pixels). The formula is in short
y = (((x / 20) / 2.5) * 360 = x * 7.2
or:
multiply your measured (cm) value with 7.2. Round the result to the
next integer number. For "A" as above, you get 5.6 * 7.2 = 40.32 or
rounded exactly 40. This means, "A" has width of 40 pixels in that
font.
3) Write the measured values into a file. Separate the numbers by
blanks. Blank lines are not allowed with one exception: the first
half of the data is for normal proportional spacing, the second half
is for superscripted or subscripted proportional spacing (that
means, you do all the measurement twice...). Between these two
parts, there may be a blank line. To make a long story short -
simply have a look at NECP6.WID.
4) Enter the name of your new file into the configuration file. And
don't throw away the listing on which you measured the characters -
may be you must check and improve some values. In case you got
measurement or computing mistakes, the proportional spacing on the
herewith printed documents will not be exactly right justified.
5) Please send me a copy of the listing or a disk with the width
values. Other people may thank you.
If you are happy to have a proportional spacing table in your printers
manual, don't be happy too early: the same happened to me, but I found
that the widths in the manual are not correct. Give them a try, and if
the printing results are not correctly right justified, see above...
------------------------------------------------------------------
Appendix D: Bugs, problems, missing features
--------------------------------------------
(this list could grow in the future...)
- Double high printing isn't correctly taken into account for the page
break.
- when using user defined characters, there may be problems with non
German texts concerning the brackets [] and braces {}. WSD uses the
special ascii codes following after "Z" and "z" to represent the
German special Umlaut characters (the NEC P6 accepts user defined
characters only in the range below ascii 128). Unfortunately, in
English texts these ascii codes are used for brackets, braces and
other special symbols. There are two remedies against that:
* avoid using these symbols when a user defined font is active. For
example, don't "#X citation [Smith] p. 120#I", but rather "#X
citation #I[#XSmith#I]#X p. 120#I".
* edit the fonts and replace the respective German Umlaut characters
by the respective English special symbols
- Cut sheet feeders actually aren't taken into account at the present.
- The use of the sequence #. is not encouraged because I implemented
and tested that only half hearted.
- There is no preview now, the best you get is with option -c (check
syntax).
- If you turn the printer off before WSD sent the printer exit string
(as defined in the respective .ESC file), WSD will gracefully halt
and report an error 160 (device write fault).
- the INclude file feature is not worked out the best. Especially the
line number counting may be mocked by the use of include files.
- the abbreviation feature is not very sophisticated. It could
probably be changed to allow definition of macros within the text
file itself.
- WSD is possibly not prepared for printers that do not support all
the printing features defined in the .ESC file (but, are there
printers that do not allow to print superscripts and the like?).
------------------------------------------------------------------